home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / you-075a.lha / you-075a / y.tab.c < prev    next >
C/C++ Source or Header  |  1992-06-18  |  31KB  |  1,170 lines

  1.  
  2. /*  A Bison parser, made from parser.yac  */
  3.  
  4. #define    IDENTIFIER    258
  5. #define    TINTEGER    259
  6. #define    TRATIONAL    260
  7. #define    TFLOAT    261
  8. #define    TCHAR    262
  9. #define    TSTRING    263
  10. #define    QUOTATION    264
  11. #define    UNQUOTATION    265
  12. #define    UNQUOTE_SPLICE    266
  13. #define    ANTI_QUOTATION    267
  14. #define    EXTENSION    268
  15. #define    PAIR_BEGIN    269
  16. #define    PAIR_END    270
  17. #define    DOT    271
  18. #define    END_OF_STREAM    272
  19.  
  20. #line 1 "parser.yac"
  21.  
  22. /* $Id: y.tab.c,v 1.4 1992/02/10 12:00:22 pab Exp $ */
  23. /* $Log: y.tab.c,v $
  24.  * Revision 1.4  1992/02/10  12:00:22  pab
  25.  * Fixed reader errors
  26.  *
  27.  * Revision 1.3  1992/01/29  20:11:18  pab
  28.  * fixed for K&R C
  29.  *
  30.  * Revision 1.2  1991/09/11  12:07:54  pab
  31.  * 11/9/91 First Alpha release of modified system
  32.  *
  33. Revision 1.5  1991/03/01  17:28:00  sm
  34. ANSI prototypes inside ifdef __STDC__ s since y.tab.c to complicated for
  35. ANSI filter
  36.  
  37. Revision 1.4  1991/03/01  16:32:28  is
  38. Modified read with line numbers I guess.
  39. (kjp)
  40.  
  41. Revision 1.3  1991/02/13  19:53:58  kjp
  42. New error handling on parse errors.
  43.  
  44. Revision 1.2  1991/02/11  18:01:44  is
  45. Added support for read-with-line-numbers
  46.  
  47. */
  48. #define YYDEBUG 0 
  49.  
  50. int yydebug=0;
  51.  
  52. #include <stdio.h>
  53. #include "funcalls.h"
  54. #include "defs.h"
  55. #include "structs.h"
  56. #include "global.h"
  57. #include "symboot.h"
  58. #include "vectors.h"
  59. #include "error.h"
  60. #include "lex_global.h"
  61.  
  62. LispObject auxx;
  63.  
  64. LispObject my_yy_val;
  65. int with_line_numbers;
  66. extern int lex_input_line_number;
  67. LispObject line_number_table;
  68. extern pptoken pptok;
  69.  
  70. #ifdef __STDC__
  71.  
  72. void yyerror(LispObject *,char *);
  73.  
  74. #else
  75.  
  76. void yyerror();
  77.  
  78. #endif
  79.  
  80. #line 53 "parser.yac"
  81. typedef union{
  82.     LispObject lspobj;
  83.       } YYSTYPE;
  84.  
  85. #ifndef YYLTYPE
  86. typedef
  87.   struct yyltype
  88.     {
  89.       int timestamp;
  90.       int first_line;
  91.       int first_column;
  92.       int last_line;
  93.       int last_column;
  94.       char *text;
  95.    }
  96.   yyltype;
  97.  
  98. #define YYLTYPE yyltype
  99. #endif
  100.  
  101. #ifndef YYDEBUG
  102. #define YYDEBUG 1
  103. #endif
  104.  
  105. #include <stdio.h>
  106.  
  107. #ifndef __STDC__
  108. #define const
  109. #endif
  110.  
  111.  
  112.  
  113. #define    YYFINAL        58
  114. #define    YYFLAG        -32768
  115. #define    YYNTBASE    18
  116.  
  117. #define YYTRANSLATE(x) ((unsigned)(x) <= 272 ? yytranslate[x] : 34)
  118.  
  119. static const char yytranslate[] = {     0,
  120.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  121.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  122.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  123.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  124.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  125.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  126.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  127.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  128.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  129.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  130.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  131.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  132.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  133.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  134.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  135.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  136.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  137.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  138.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  139.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  140.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  141.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  142.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  143.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  144.      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
  145.      2,     2,     2,     2,     2,     1,     2,     3,     4,     5,
  146.      6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
  147.     16,    17
  148. };
  149.  
  150. static const short yyprhs[] = {     0,
  151.      0,     2,     4,     6,     8,    10,    12,    14,    16,    18,
  152.     20,    22,    24,    26,    28,    30,    32,    34,    36,    38,
  153.     40,    42,    44,    46,    48,    49,    53,    58,    62,    64,
  154.     68,    71,    75,    76,    78,    81,    84,    86,    88,    90,
  155.     92,    96,    99
  156. };
  157.  
  158. static const short yyrhs[] = {    19,
  159.      0,    17,     0,    21,     0,    23,     0,    22,     0,    23,
  160.      0,     4,     0,     5,     0,     6,     0,     7,     0,     8,
  161.      0,     3,     0,    16,     0,    15,     0,     4,     0,     5,
  162.      0,     6,     0,     7,     0,     8,     0,     3,     0,    24,
  163.      0,    33,     0,    26,     0,    30,     0,     0,    14,    25,
  164.     15,     0,    14,    25,    20,    27,     0,    14,     1,    15,
  165.      0,    15,     0,    16,    20,    15,     0,    20,    27,     0,
  166.     16,     1,    15,     0,     0,    29,     0,    20,    28,     0,
  167.     31,    19,     0,     9,     0,    10,     0,    11,     0,    12,
  168.      0,    14,    28,    15,     0,    13,    32,     0,    13,     1,
  169.     15,     0
  170. };
  171.  
  172. #if YYDEBUG != 0
  173. static const short yyrline[] = { 0,
  174.     67,    68,    71,    72,    75,    76,    79,    80,    81,    82,
  175.     83,    85,    87,    88,    92,    93,    94,    95,    96,    98,
  176.    102,   103,   106,   107,   110,   113,   114,   118,   121,   122,
  177.    123,   124,   127,   128,   131,   134,   137,   138,   139,   140,
  178.    143,   145,   147
  179. };
  180.  
  181. static const char * const yytname[] = {   "$",
  182. "error","$illegal.","IDENTIFIER","TINTEGER","TRATIONAL","TFLOAT","TCHAR","TSTRING","QUOTATION","UNQUOTATION",
  183. "UNQUOTE_SPLICE","ANTI_QUOTATION","EXTENSION","PAIR_BEGIN","PAIR_END","DOT","END_OF_STREAM","top_data","data_top","inner_data",
  184. "top_simple","inner_simple","compound","list","line_number","list_or_pair","more_data","inner_data_star","inner_data_plus","abbreviation",
  185. "prefix","simple_list","vector",""
  186. };
  187. #endif
  188.  
  189. static const short yyr1[] = {     0,
  190.     18,    18,    19,    19,    20,    20,    21,    21,    21,    21,
  191.     21,    21,    21,    21,    22,    22,    22,    22,    22,    22,
  192.     23,    23,    24,    24,    25,    26,    26,    26,    27,    27,
  193.     27,    27,    28,    28,    29,    30,    31,    31,    31,    31,
  194.     32,    33,    33
  195. };
  196.  
  197. static const short yyr2[] = {     0,
  198.      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  199.      1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
  200.      1,     1,     1,     1,     0,     3,     4,     3,     1,     3,
  201.      2,     3,     0,     1,     2,     2,     1,     1,     1,     1,
  202.      3,     2,     3
  203. };
  204.  
  205. static const short yydefact[] = {     0,
  206.     12,     7,     8,     9,    10,    11,    37,    38,    39,    40,
  207.      0,     0,    14,    13,     2,     1,     3,     4,    21,    23,
  208.     24,     0,    22,     0,    33,    42,     0,     0,    36,    43,
  209.     20,    15,    16,    17,    18,    19,    33,     5,     6,     0,
  210.     34,    28,    26,     0,    35,    41,    29,     0,     0,    27,
  211.      0,     0,    31,    32,    30,     0,     0,     0
  212. };
  213.  
  214. static const short yydefgoto[] = {    56,
  215.     16,    37,    17,    38,    39,    19,    28,    20,    50,    40,
  216.     41,    21,    22,    26,    23
  217. };
  218.  
  219. static const short yypact[] = {     1,
  220. -32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  221.     68,    24,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
  222. -32768,    37,-32768,   -14,    93,-32768,   -13,    80,-32768,-32768,
  223. -32768,-32768,-32768,-32768,-32768,-32768,    93,-32768,-32768,     5,
  224. -32768,-32768,-32768,    51,-32768,-32768,-32768,    67,    51,-32768,
  225.      6,    11,-32768,-32768,-32768,   108,   109,-32768
  226. };
  227.  
  228. static const short yypgoto[] = {-32768,
  229.     88,   -25,-32768,-32768,     0,-32768,-32768,-32768,    62,    75,
  230. -32768,-32768,-32768,-32768,-32768
  231. };
  232.  
  233.  
  234. #define    YYLAST        112
  235.  
  236.  
  237. static const short yytable[] = {    18,
  238.     30,    42,    44,     1,     2,     3,     4,     5,     6,     7,
  239.      8,     9,    10,    11,    12,    13,    14,    15,    49,    46,
  240.     54,    18,    52,    49,    27,    55,   -25,   -25,   -25,   -25,
  241.    -25,   -25,   -25,   -25,   -25,   -25,   -25,   -25,   -25,     1,
  242.      2,     3,     4,     5,     6,     7,     8,     9,    10,    11,
  243.     12,    13,    14,    31,    32,    33,    34,    35,    36,     7,
  244.      8,     9,    10,    11,    12,    47,    48,    51,    24,    31,
  245.     32,    33,    34,    35,    36,     7,     8,     9,    10,    11,
  246.     12,    25,    31,    32,    33,    34,    35,    36,     7,     8,
  247.      9,    10,    11,    12,    43,    31,    32,    33,    34,    35,
  248.     36,     7,     8,     9,    10,    11,    12,    57,    58,    29,
  249.     53,    45
  250. };
  251.  
  252. static const short yycheck[] = {     0,
  253.     15,    15,    28,     3,     4,     5,     6,     7,     8,     9,
  254.     10,    11,    12,    13,    14,    15,    16,    17,    44,    15,
  255.     15,    22,    48,    49,     1,    15,     3,     4,     5,     6,
  256.      7,     8,     9,    10,    11,    12,    13,    14,    15,     3,
  257.      4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
  258.     14,    15,    16,     3,     4,     5,     6,     7,     8,     9,
  259.     10,    11,    12,    13,    14,    15,    16,     1,     1,     3,
  260.      4,     5,     6,     7,     8,     9,    10,    11,    12,    13,
  261.     14,    14,     3,     4,     5,     6,     7,     8,     9,    10,
  262.     11,    12,    13,    14,    15,     3,     4,     5,     6,     7,
  263.      8,     9,    10,    11,    12,    13,    14,     0,     0,    22,
  264.     49,    37
  265. };
  266. /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
  267. #line 3 "bison.simple"
  268.  
  269. /* Skeleton output parser for bison,
  270.    Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
  271.  
  272.    This program is free software; you can redistribute it and/or modify
  273.    it under the terms of the GNU General Public License as published by
  274.    the Free Software Foundation; either version 1, or (at your option)
  275.    any later version.
  276.  
  277.    This program is distributed in the hope that it will be useful,
  278.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  279.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  280.    GNU General Public License for more details.
  281.  
  282.    You should have received a copy of the GNU General Public License
  283.    along with this program; if not, write to the Free Software
  284.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  285.  
  286.  
  287. #ifndef alloca
  288. #ifdef __GNUC__
  289. #define alloca __builtin_alloca
  290. #else /* Not GNU C.  */
  291. #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
  292. #include <alloca.h>
  293. #else /* Not sparc */
  294. #ifdef MSDOS
  295. #include <malloc.h>
  296. #endif /* MSDOS */
  297. #endif /* Not sparc.  */
  298. #endif /* Not GNU C.  */
  299. #endif /* alloca not defined.  */
  300.  
  301. /* This is the parser code that is written into each bison parser
  302.   when the %semantic_parser declaration is not specified in the grammar.
  303.   It was written by Richard Stallman by simplifying the hairy parser
  304.   used when %semantic_parser is specified.  */
  305.  
  306. /* Note: there must be only one dollar sign in this file.
  307.    It is replaced by the list of actions, each action
  308.    as one case of the switch.  */
  309.  
  310. #define yyerrok        (yyerrstatus = 0)
  311. #define yyclearin    (yychar = YYEMPTY)
  312. #define YYEMPTY        -2
  313. #define YYEOF        0
  314. #define YYACCEPT    return(0)
  315. #define YYABORT     return(1)
  316. #define YYERROR        goto yyerrlab1
  317. /* Like YYERROR except do call yyerror.
  318.    This remains here temporarily to ease the
  319.    transition to the new meaning of YYERROR, for GCC.
  320.    Once GCC version 2 has supplanted version 1, this can go.  */
  321. #define YYFAIL        goto yyerrlab
  322. #define YYRECOVERING()  (!!yyerrstatus)
  323. #define YYBACKUP(token, value) \
  324. do                                \
  325.   if (yychar == YYEMPTY && yylen == 1)                \
  326.     { yychar = (token), yylval = (value);            \
  327.       yychar1 = YYTRANSLATE (yychar);                \
  328.       YYPOPSTACK;                        \
  329.       goto yybackup;                        \
  330.     }                                \
  331.   else                                \
  332.     { yyerror ("syntax error: cannot back up"); YYERROR; }    \
  333. while (0)
  334.  
  335. #define YYTERROR    1
  336. #define YYERRCODE    256
  337.  
  338. #ifndef YYPURE
  339. #define YYLEX        yylex(stacktop)
  340. #endif
  341.  
  342. #ifdef YYPURE
  343. #ifdef YYLSP_NEEDED
  344. #define YYLEX        yylex(stacktop,&yylval, &yylloc)
  345. #else
  346. #define YYLEX        yylex(stacktop,&yylval)
  347. #endif
  348. #endif
  349.  
  350. /* If nonreentrant, generate the variables here */
  351.  
  352. #ifndef YYPURE
  353.  
  354. int    yychar;            /*  the lookahead symbol        */
  355. YYSTYPE    yylval;            /*  the semantic value of the        */
  356.                 /*  lookahead symbol            */
  357.  
  358. #ifdef YYLSP_NEEDED
  359. YYLTYPE yylloc;            /*  location data for the lookahead    */
  360.                 /*  symbol                */
  361. #endif
  362.  
  363. int yynerrs;            /*  number of parse errors so far       */
  364. #endif  /* not YYPURE */
  365.  
  366. #if YYDEBUG != 0
  367. int yydebug;            /*  nonzero means print parse trace    */
  368. /* Since this is uninitialized, it does not stop multiple parsers
  369.    from coexisting.  */
  370. #endif
  371.  
  372. /*  YYINITDEPTH indicates the initial size of the parser's stacks    */
  373.  
  374. #ifndef    YYINITDEPTH
  375. #define YYINITDEPTH 200
  376. #endif
  377.  
  378. /*  YYMAXDEPTH is the maximum size the stacks can grow to
  379.     (effective only if the built-in stack extension method is used).  */
  380.  
  381. #if YYMAXDEPTH == 0
  382. #undef YYMAXDEPTH
  383. #endif
  384.  
  385. #ifndef YYMAXDEPTH
  386. #define YYMAXDEPTH 10000
  387. #endif
  388.  
  389. #ifndef __cplusplus
  390.  
  391. /* This is the most reliable way to avoid incompatibilities
  392.    in available built-in functions on various systems.  */
  393. static void
  394. __yy_bcopy (from, to, count)
  395.      char *from;
  396.      char *to;
  397.      int count;
  398. {
  399.   register char *f = from;
  400.   register char *t = to;
  401.   register int i = count;
  402.  
  403.   while (i-- > 0)
  404.     *t++ = *f++;
  405. }
  406.  
  407. #else /* __cplusplus */
  408.  
  409. /* This is the most reliable way to avoid incompatibilities
  410.    in available built-in functions on various systems.  */
  411. static void
  412. __yy_bcopy (char *from, char *to, int count)
  413. {
  414.   register char *f = from;
  415.   register char *t = to;
  416.   register int i = count;
  417.  
  418.   while (i-- > 0)
  419.     *t++ = *f++;
  420. }
  421.  
  422. #endif
  423.  
  424. #line 160 "bison.simple"
  425. #ifdef __STDC__
  426. int
  427. yyparse(LispObject *stacktop)
  428. #else
  429. int yyparse(stacktop)
  430. LispObject *stacktop;
  431. #endif
  432. {
  433.   register int yystate;
  434.   register int yyn;
  435.   register short *yyssp;
  436.   register YYSTYPE *yyvsp;
  437.   int yyerrstatus;    /*  number of tokens to shift before error messages enabled */
  438.   int yychar1;        /*  lookahead token as an internal (translated) token number */
  439.  
  440.   short    yyssa[YYINITDEPTH];    /*  the state stack            */
  441.   YYSTYPE yyvsa[YYINITDEPTH];    /*  the semantic value stack        */
  442.  
  443.   short *yyss = yyssa;        /*  refer to the stacks thru separate pointers */
  444.   YYSTYPE *yyvs = yyvsa;    /*  to allow yyoverflow to reallocate them elsewhere */
  445.  
  446. #ifdef YYLSP_NEEDED
  447.   YYLTYPE *yyls = yylsa;
  448.   YYLTYPE *yylsp;
  449.   YYLTYPE yylsa[YYINITDEPTH];    /*  the location stack            */
  450.  
  451. #define YYPOPSTACK   (yyvsp--, yysp--, yylsp--)
  452. #else
  453. #define YYPOPSTACK   (yyvsp--, yysp--)
  454. #endif
  455.  
  456.   int yystacksize = YYINITDEPTH;
  457.  
  458. #ifdef YYPURE
  459.   int yychar;
  460.   YYSTYPE yylval;
  461.   int yynerrs;
  462. #ifdef YYLSP_NEEDED
  463.   YYLTYPE yylloc;
  464. #endif
  465. #endif
  466.  
  467.   YYSTYPE yyval;        /*  the variable used to return        */
  468.                 /*  semantic values from the action    */
  469.                 /*  routines                */
  470.  
  471.   int yylen;
  472.  
  473. #if YYDEBUG != 0
  474.   if (yydebug)
  475.     fprintf(stderr, "Starting parse\n");
  476. #endif
  477.  
  478.   yystate = 0;
  479.   yyerrstatus = 0;
  480.   yynerrs = 0;
  481.   yychar = YYEMPTY;        /* Cause a token to be read.  */
  482.  
  483.   /* Initialize stack pointers.
  484.      Waste one element of value and location stack
  485.      so that they stay on the same level as the state stack.  */
  486.  
  487.   yyssp = yyss - 1;
  488.   yyvsp = yyvs;
  489. #ifdef YYLSP_NEEDED
  490.   yylsp = yyls;
  491. #endif
  492.  
  493. /* Push a new state, which is found in  yystate  .  */
  494. /* In all cases, when you get here, the value and location stacks
  495.    have just been pushed. so pushing a state here evens the stacks.  */
  496. yynewstate:
  497.  
  498.   *++yyssp = yystate;
  499.  
  500.   if (yyssp >= yyss + yystacksize - 1)
  501.     {
  502.       /* Give user a chance to reallocate the stack */
  503.       /* Use copies of these so that the &'s don't force the real ones into memory. */
  504.       YYSTYPE *yyvs1 = yyvs;
  505.       short *yyss1 = yyss;
  506. #ifdef YYLSP_NEEDED
  507.       YYLTYPE *yyls1 = yyls;
  508. #endif
  509.  
  510.       /* Get the current used size of the three stacks, in elements.  */
  511.       int size = yyssp - yyss + 1;
  512.  
  513. #ifdef yyoverflow
  514.       /* Each stack pointer address is followed by the size of
  515.      the data in use in that stack, in bytes.  */
  516.       yyoverflow("parser stack overflow",
  517.          &yyss1, size * sizeof (*yyssp),
  518.          &yyvs1, size * sizeof (*yyvsp),
  519. #ifdef YYLSP_NEEDED
  520.          &yyls1, size * sizeof (*yylsp),
  521. #endif
  522.          &yystacksize);
  523.  
  524.       yyss = yyss1; yyvs = yyvs1;
  525. #ifdef YYLSP_NEEDED
  526.       yyls = yyls1;
  527. #endif
  528. #else /* no yyoverflow */
  529.       /* Extend the stack our own way.  */
  530.       if (yystacksize >= YYMAXDEPTH)
  531.     {
  532.       yyerror(stacktop,"parser stack overflow");
  533.       return 2;
  534.     }
  535.       yystacksize *= 2;
  536.       if (yystacksize > YYMAXDEPTH)
  537.     yystacksize = YYMAXDEPTH;
  538.       yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
  539.       __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
  540.       yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
  541.       __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
  542. #ifdef YYLSP_NEEDED
  543.       yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
  544.       __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
  545. #endif
  546. #endif /* no yyoverflow */
  547.  
  548.       yyssp = yyss + size - 1;
  549.       yyvsp = yyvs + size - 1;
  550. #ifdef YYLSP_NEEDED
  551.       yylsp = yyls + size - 1;
  552. #endif
  553.  
  554. #if YYDEBUG != 0
  555.       if (yydebug)
  556.     fprintf(stderr, "Stack size increased to %d\n", yystacksize);
  557. #endif
  558.  
  559.       if (yyssp >= yyss + yystacksize - 1)
  560.     YYABORT;
  561.     }
  562.  
  563. #if YYDEBUG != 0
  564.   if (yydebug)
  565.     fprintf(stderr, "Entering state %d\n", yystate);
  566. #endif
  567.  
  568.  yybackup:
  569.  
  570. /* Do appropriate processing given the current state.  */
  571. /* Read a lookahead token if we need one and don't already have one.  */
  572. /* yyresume: */
  573.  
  574.   /* First try to decide what to do without reference to lookahead token.  */
  575.  
  576.   yyn = yypact[yystate];
  577.   if (yyn == YYFLAG)
  578.     goto yydefault;
  579.  
  580.   /* Not known => get a lookahead token if don't already have one.  */
  581.  
  582.   /* yychar is either YYEMPTY or YYEOF
  583.      or a valid token in external form.  */
  584.  
  585.   if (yychar == YYEMPTY)
  586.     {
  587. #if YYDEBUG != 0
  588.       if (yydebug)
  589.     fprintf(stderr, "Reading a token: ");
  590. #endif
  591.       yychar = YYLEX;
  592.     }
  593.  
  594.   /* Convert token to internal form (in yychar1) for indexing tables with */
  595.  
  596.   if (yychar <= 0)        /* This means end of input. */
  597.     {
  598.       yychar1 = 0;
  599.       yychar = YYEOF;        /* Don't call YYLEX any more */
  600.  
  601. #if YYDEBUG != 0
  602.       if (yydebug)
  603.     fprintf(stderr, "Now at end of input.\n");
  604. #endif
  605.     }
  606.   else
  607.     {
  608.       yychar1 = YYTRANSLATE(yychar);
  609.  
  610. #if YYDEBUG != 0
  611.       if (yydebug)
  612.     fprintf(stderr, "Next token is %d (%s)\n", yychar, yytname[yychar1]);
  613. #endif
  614.     }
  615.  
  616.   yyn += yychar1;
  617.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
  618.     goto yydefault;
  619.  
  620.   yyn = yytable[yyn];
  621.  
  622.   /* yyn is what to do for this token type in this state.
  623.      Negative => reduce, -yyn is rule number.
  624.      Positive => shift, yyn is new state.
  625.        New state is final state => don't bother to shift,
  626.        just return success.
  627.      0, or most negative number => error.  */
  628.  
  629.   if (yyn < 0)
  630.     {
  631.       if (yyn == YYFLAG)
  632.     goto yyerrlab;
  633.       yyn = -yyn;
  634.       goto yyreduce;
  635.     }
  636.   else if (yyn == 0)
  637.     goto yyerrlab;
  638.  
  639.   if (yyn == YYFINAL)
  640.     YYACCEPT;
  641.  
  642.   /* Shift the lookahead token.  */
  643.  
  644. #if YYDEBUG != 0
  645.   if (yydebug)
  646.     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
  647. #endif
  648.  
  649.   /* Discard the token being shifted unless it is eof.  */
  650.   if (yychar != YYEOF)
  651.     yychar = YYEMPTY;
  652.  
  653.   *++yyvsp = yylval;
  654. #ifdef YYLSP_NEEDED
  655.   *++yylsp = yylloc;
  656. #endif
  657.  
  658.   /* count tokens shifted since error; after three, turn off error status.  */
  659.   if (yyerrstatus) yyerrstatus--;
  660.  
  661.   yystate = yyn;
  662.   goto yynewstate;
  663.  
  664. /* Do the default action for the current state.  */
  665. yydefault:
  666.  
  667.   yyn = yydefact[yystate];
  668.   if (yyn == 0)
  669.     goto yyerrlab;
  670.  
  671. /* Do a reduction.  yyn is the number of a rule to reduce with.  */
  672. yyreduce:
  673.   yylen = yyr2[yyn];
  674.   yyval = yyvsp[1-yylen]; /* implement default value of the action */
  675.  
  676. #if YYDEBUG != 0
  677.   if (yydebug)
  678.     {
  679.       int i;
  680.  
  681.       fprintf (stderr, "Reducing via rule %d (line %d), ",
  682.            yyn, yyrline[yyn]);
  683.  
  684.       /* Print the symboles being reduced, and their result.  */
  685.       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
  686.     fprintf (stderr, "%s ", yytname[yyrhs[i]]);
  687.       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
  688.     }
  689. #endif
  690.  
  691.  
  692.   switch (yyn) {
  693.  
  694. case 1:
  695. #line 67 "parser.yac"
  696. { my_yy_val = yyvsp[0].lspobj; YYACCEPT; ;
  697.     break;}
  698. case 2:
  699. #line 68 "parser.yac"
  700. { my_yy_val = q_eof; yyval.lspobj=q_eof; YYACCEPT; ;
  701.     break;}
  702. case 3:
  703. #line 71 "parser.yac"
  704. { yyval.lspobj=yyvsp[0].lspobj; ;
  705.     break;}
  706. case 4:
  707. #line 72 "parser.yac"
  708. {  yyval.lspobj=yyvsp[0].lspobj; ;
  709.     break;}
  710. case 5:
  711. #line 75 "parser.yac"
  712. { yyval.lspobj=yyvsp[0].lspobj;  ;
  713.     break;}
  714. case 6:
  715. #line 76 "parser.yac"
  716. { yyval.lspobj=yyvsp[0].lspobj;   ;
  717.     break;}
  718. case 7:
  719. #line 79 "parser.yac"
  720. { yyval.lspobj=allocate_integer(stacktop,pptok.int_val);;
  721.     break;}
  722. case 8:
  723. #line 80 "parser.yac"
  724. { yyval.lspobj=allocate_ratio(stacktop,(LispObject)allocate_integer(stacktop,pptok.int_val),(LispObject)allocate_integer(stacktop,pptok.rat_den_val));;
  725.     break;}
  726. case 9:
  727. #line 81 "parser.yac"
  728. { yyval.lspobj=allocate_float(stacktop,pptok.float_val); ;
  729.     break;}
  730. case 10:
  731. #line 82 "parser.yac"
  732. { yyval.lspobj=allocate_char(stacktop,pptok.char_val); ;
  733.     break;}
  734. case 11:
  735. #line 83 "parser.yac"
  736. { yyval.lspobj=pptok.string_val;
  737.                          ;
  738.     break;}
  739. case 12:
  740. #line 85 "parser.yac"
  741. { yyval.lspobj=get_symbol_by_copying(stacktop,pptok.sym_val);
  742.                         ;
  743.     break;}
  744. case 13:
  745. #line 87 "parser.yac"
  746. { Reader_CallError(stacktop,"Misplaced dot ignored\n",nil,NONCONTINUABLE); ;
  747.     break;}
  748. case 14:
  749. #line 89 "parser.yac"
  750. { Reader_CallError(stacktop,"Spurious closing parenthesis ignored\n",nil,NONCONTINUABLE); ;
  751.     break;}
  752. case 15:
  753. #line 92 "parser.yac"
  754. { yyval.lspobj=allocate_integer(stacktop,pptok.int_val); ;
  755.     break;}
  756. case 16:
  757. #line 93 "parser.yac"
  758. { yyval.lspobj=allocate_ratio(stacktop,(LispObject)allocate_integer(stacktop,pptok.int_val),(LispObject)allocate_integer(stacktop,pptok.rat_den_val));;
  759.     break;}
  760. case 17:
  761. #line 94 "parser.yac"
  762. { yyval.lspobj=allocate_float(stacktop,pptok.float_val);  ;
  763.     break;}
  764. case 18:
  765. #line 95 "parser.yac"
  766. { yyval.lspobj=allocate_char(stacktop,pptok.char_val);  ;
  767.     break;}
  768. case 19:
  769. #line 96 "parser.yac"
  770. { yyval.lspobj=pptok.string_val;
  771.                         ;
  772.     break;}
  773. case 20:
  774. #line 98 "parser.yac"
  775. { yyval.lspobj=get_symbol_by_copying(stacktop,pptok.sym_val);  
  776.                         ;
  777.     break;}
  778. case 21:
  779. #line 102 "parser.yac"
  780. { yyval.lspobj=yyvsp[0].lspobj;  ;
  781.     break;}
  782. case 22:
  783. #line 103 "parser.yac"
  784. { yyval.lspobj=yyvsp[0].lspobj;  ;
  785.     break;}
  786. case 23:
  787. #line 106 "parser.yac"
  788. { yyval.lspobj=yyvsp[0].lspobj; ;
  789.     break;}
  790. case 24:
  791. #line 107 "parser.yac"
  792. { yyval.lspobj=yyvsp[0].lspobj; ;
  793.     break;}
  794. case 25:
  795. #line 110 "parser.yac"
  796. {/* line_number is just a place holder */
  797.         yyval.lspobj = allocate_integer(stacktop,lex_input_line_number) ; ;
  798.     break;}
  799. case 26:
  800. #line 113 "parser.yac"
  801. { yyval.lspobj=nil; ;
  802.     break;}
  803. case 27:
  804. #line 115 "parser.yac"
  805. { if (with_line_numbers) {
  806.     yyval.lspobj=EUCALL_2(Fn_cons,yyvsp[-1].lspobj,yyvsp[0].lspobj);
  807.     EUCALL_3(tref_updator,line_number_table,yyval.lspobj,yyvsp[-2].lspobj);}
  808.                     else yyval.lspobj=EUCALL_2(Fn_cons,yyvsp[-1].lspobj,yyvsp[0].lspobj);;
  809.     break;}
  810. case 28:
  811. #line 118 "parser.yac"
  812. {Reader_CallError(stacktop,"Error building list or dotted pair\n",nil,NONCONTINUABLE);;
  813.     break;}
  814. case 29:
  815. #line 121 "parser.yac"
  816. { yyval.lspobj=nil; ;
  817.     break;}
  818. case 30:
  819. #line 122 "parser.yac"
  820. { yyval.lspobj=yyvsp[-1].lspobj; ;
  821.     break;}
  822. case 31:
  823. #line 123 "parser.yac"
  824. { EUCALLSET_2(yyval.lspobj,Fn_cons,yyvsp[-1].lspobj,yyvsp[0].lspobj);;
  825.     break;}
  826. case 32:
  827. #line 124 "parser.yac"
  828. { Reader_CallError(stacktop,"Error building dotted pair\n",nil,NONCONTINUABLE);;
  829.     break;}
  830. case 33:
  831. #line 127 "parser.yac"
  832. { yyval.lspobj=nil; ;
  833.     break;}
  834. case 34:
  835. #line 128 "parser.yac"
  836. { yyval.lspobj=yyvsp[0].lspobj; ;
  837.     break;}
  838. case 35:
  839. #line 131 "parser.yac"
  840. { EUCALLSET_2(yyval.lspobj,Fn_cons,yyvsp[-1].lspobj,yyvsp[0].lspobj); ;
  841.     break;}
  842. case 36:
  843. #line 134 "parser.yac"
  844. { LispObject xx;
  845.   xx = EUCALL_2(Fn_cons,yyvsp[0].lspobj,nil);
  846.   yyval.lspobj=EUCALL_2(Fn_cons,yyvsp[-1].lspobj,xx); ;
  847.     break;}
  848. case 37:
  849. #line 137 "parser.yac"
  850. {  yyval.lspobj=sym_quote;  ;
  851.     break;}
  852. case 38:
  853. #line 138 "parser.yac"
  854. {  yyval.lspobj=sym_unquote; ;
  855.     break;}
  856. case 39:
  857. #line 139 "parser.yac"
  858. {  yyval.lspobj=get_symbol(stacktop,"unquote-splicing"); ;
  859.     break;}
  860. case 40:
  861. #line 140 "parser.yac"
  862. {  yyval.lspobj=get_symbol(stacktop,"quasiquote"); ;
  863.     break;}
  864. case 41:
  865. #line 143 "parser.yac"
  866. { yyval.lspobj=yyvsp[-1].lspobj; ;
  867.     break;}
  868. case 42:
  869. #line 146 "parser.yac"
  870. { EUCALLSET_1(yyval.lspobj,Fn_vector,yyvsp[0].lspobj); ;
  871.     break;}
  872. case 43:
  873. #line 148 "parser.yac"
  874. {
  875.          Reader_CallError(stacktop,"Error building vector\n",nil,NONCONTINUABLE); ;
  876.     break;}
  877. }
  878.    /* the action file gets copied in in place of this dollarsign */
  879. #line 423 "bison.simple"
  880.  
  881.   yyvsp -= yylen;
  882.   yyssp -= yylen;
  883. #ifdef YYLSP_NEEDED
  884.   yylsp -= yylen;
  885. #endif
  886.  
  887. #if YYDEBUG != 0
  888.   if (yydebug)
  889.     {
  890.       short *ssp1 = yyss - 1;
  891.       fprintf (stderr, "state stack now");
  892.       while (ssp1 != yyssp)
  893.     fprintf (stderr, " %d", *++ssp1);
  894.       fprintf (stderr, "\n");
  895.     }
  896. #endif
  897.  
  898.   *++yyvsp = yyval;
  899.  
  900. #ifdef YYLSP_NEEDED
  901.   yylsp++;
  902.   if (yylen == 0)
  903.     {
  904.       yylsp->first_line = yylloc.first_line;
  905.       yylsp->first_column = yylloc.first_column;
  906.       yylsp->last_line = (yylsp-1)->last_line;
  907.       yylsp->last_column = (yylsp-1)->last_column;
  908.       yylsp->text = 0;
  909.     }
  910.   else
  911.     {
  912.       yylsp->last_line = (yylsp+yylen-1)->last_line;
  913.       yylsp->last_column = (yylsp+yylen-1)->last_column;
  914.     }
  915. #endif
  916.  
  917.   /* Now "shift" the result of the reduction.
  918.      Determine what state that goes to,
  919.      based on the state we popped back to
  920.      and the rule number reduced by.  */
  921.  
  922.   yyn = yyr1[yyn];
  923.  
  924.   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
  925.   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
  926.     yystate = yytable[yystate];
  927.   else
  928.     yystate = yydefgoto[yyn - YYNTBASE];
  929.  
  930.   goto yynewstate;
  931.  
  932. yyerrlab:   /* here on detecting error */
  933.  
  934.   if (! yyerrstatus)
  935.     /* If not already recovering from an error, report this error.  */
  936.     {
  937.       ++yynerrs;
  938.  
  939. #ifdef YYERROR_VERBOSE
  940.       yyn = yypact[yystate];
  941.  
  942.       if (yyn > YYFLAG && yyn < YYLAST)
  943.     {
  944.       int size = 0;
  945.       char *msg;
  946.       int x, count;
  947.  
  948.       count = 0;
  949.       for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  950.         if (yycheck[x + yyn] == x)
  951.           size += strlen(yytname[x]) + 15, count++;
  952.       msg = (char *) xmalloc(size + 15);
  953.       strcpy(msg, "parse error");
  954.  
  955.       if (count < 5)
  956.         {
  957.           count = 0;
  958.           for (x = 0; x < (sizeof(yytname) / sizeof(char *)); x++)
  959.         if (yycheck[x + yyn] == x)
  960.           {
  961.             strcat(msg, count == 0 ? ", expecting `" : " or `");
  962.             strcat(msg, yytname[x]);
  963.             strcat(msg, "'");
  964.             count++;
  965.           }
  966.         }
  967.       yyerror(stacktop,msg);
  968.       free(msg);
  969.     }
  970.       else
  971. #endif /* YYERROR_VERBOSE */
  972.     yyerror(stacktop,"parse error");
  973.     }
  974.  
  975. yyerrlab1:   /* here on error raised explicitly by an action */
  976.  
  977.   if (yyerrstatus == 3)
  978.     {
  979.       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
  980.  
  981.       /* return failure if at end of input */
  982.       if (yychar == YYEOF)
  983.     YYABORT;
  984.  
  985. #if YYDEBUG != 0
  986.       if (yydebug)
  987.     fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
  988. #endif
  989.  
  990.       yychar = YYEMPTY;
  991.     }
  992.  
  993.   /* Else will try to reuse lookahead token
  994.      after shifting the error token.  */
  995.  
  996.   yyerrstatus = 3;        /* Each real token shifted decrements this */
  997.  
  998.   goto yyerrhandle;
  999.  
  1000. yyerrdefault:  /* current state does not do anything special for the error token. */
  1001.  
  1002. #if 0
  1003.   /* This is wrong; only states that explicitly want error tokens
  1004.      should shift them.  */
  1005.   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
  1006.   if (yyn) goto yydefault;
  1007. #endif
  1008.  
  1009. yyerrpop:   /* pop the current state because it cannot handle the error token */
  1010.  
  1011.   if (yyssp == yyss) YYABORT;
  1012.   yyvsp--;
  1013.   yystate = *--yyssp;
  1014. #ifdef YYLSP_NEEDED
  1015.   yylsp--;
  1016. #endif
  1017.  
  1018. #if YYDEBUG != 0
  1019.   if (yydebug)
  1020.     {
  1021.       short *ssp1 = yyss - 1;
  1022.       fprintf (stderr, "Error: state stack now");
  1023.       while (ssp1 != yyssp)
  1024.     fprintf (stderr, " %d", *++ssp1);
  1025.       fprintf (stderr, "\n");
  1026.     }
  1027. #endif
  1028.  
  1029. yyerrhandle:
  1030.  
  1031.   yyn = yypact[yystate];
  1032.   if (yyn == YYFLAG)
  1033.     goto yyerrdefault;
  1034.  
  1035.   yyn += YYTERROR;
  1036.   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
  1037.     goto yyerrdefault;
  1038.  
  1039.   yyn = yytable[yyn];
  1040.   if (yyn < 0)
  1041.     {
  1042.       if (yyn == YYFLAG)
  1043.     goto yyerrpop;
  1044.       yyn = -yyn;
  1045.       goto yyreduce;
  1046.     }
  1047.   else if (yyn == 0)
  1048.     goto yyerrpop;
  1049.  
  1050.   if (yyn == YYFINAL)
  1051.     YYACCEPT;
  1052.  
  1053. #if YYDEBUG != 0
  1054.   if (yydebug)
  1055.     fprintf(stderr, "Shifting error token, ");
  1056. #endif
  1057.  
  1058.   *++yyvsp = yylval;
  1059. #ifdef YYLSP_NEEDED
  1060.   *++yylsp = yylloc;
  1061. #endif
  1062.  
  1063.   yystate = yyn;
  1064.   goto yynewstate;
  1065. }
  1066. #line 152 "parser.yac"
  1067.  
  1068.  
  1069. #ifdef __STDC__
  1070.  
  1071. void yyerror(LispObject *stacktop,char *s)
  1072.  
  1073. #else
  1074.  
  1075. void yyerror(stacktop,s) 
  1076. LispObject *stacktop;
  1077. char *s;
  1078.  
  1079. #endif
  1080. {
  1081.   Reader_CallError(stacktop,"System parser error - watch your brackets!",nil,NONCONTINUABLE);
  1082. }
  1083.  
  1084. #ifdef __STDC__
  1085.  
  1086. LispObject Fn_Lex_Yacc_reader(LispObject *stacktop,FILE *fd)
  1087.  
  1088. #else
  1089.  
  1090. LispObject Fn_Lex_Yacc_reader(stacktop,fd)
  1091. LispObject *stacktop;
  1092. FILE *fd;
  1093.  
  1094. #endif
  1095. {
  1096. #ifdef WITH_FUDGE
  1097.  
  1098. #ifdef __STDC__
  1099.   extern void yy_set_stream(FILE *);
  1100. #else
  1101.   extern void yy_set_stream();
  1102. #endif
  1103. #else
  1104.   extern FILE *yyin;
  1105. #endif
  1106.   int ret;
  1107.   with_line_numbers=0;
  1108. #ifdef WITH_FUDGE
  1109.   yy_set_stream(fd);
  1110. #else
  1111.   yyin = fd;
  1112. #endif
  1113.  
  1114.   ret = yyparse(stacktop);
  1115.   
  1116.   if (ret != 0) {
  1117.     fprintf(stderr,"Something strange...\n"); fflush(stderr);
  1118.     return(q_eof);
  1119.   }
  1120.   else
  1121.     return((LispObject) (my_yy_val));
  1122. }
  1123.  
  1124. #ifdef __STDC__
  1125.  
  1126. LispObject Fn_Lex_Yacc_reader_linenos(LispObject *stacktop,FILE *fd)
  1127.  
  1128. #else
  1129.  
  1130. LispObject Fn_Lex_Yacc_reader_linenos(stacktop,fd)
  1131. LispObject *stacktop;
  1132. FILE *fd;
  1133.  
  1134. #endif
  1135. {
  1136. #ifdef WITH_FUDGE
  1137. #ifdef __STDC__
  1138.   extern void yy_set_stream(FILE *);
  1139. #else
  1140.   extern void yy_set_stream();
  1141. #endif
  1142. #else
  1143.   extern FILE *yyin;
  1144. #endif
  1145.   struct table_structure *allocate_tabl();
  1146.   LispObject Fn_eq();
  1147.   LispObject Fn_cons();
  1148.   int ret;
  1149.  
  1150.   with_line_numbers=1;
  1151. #ifdef WITH_FUDGE
  1152.   yy_set_stream(fd);
  1153. #else
  1154.   yyin = fd;
  1155. #endif
  1156.   line_number_table = (LispObject) allocate_table(stacktop,Fn_eq);
  1157.   STACK(line_number_table);
  1158.   ret = yyparse(stacktop);
  1159.  
  1160.   if (ret != 0) {
  1161.     fprintf(stderr,"Something strange...\n"); fflush(stderr);
  1162.     return(q_eof);
  1163.   }
  1164.   else {
  1165.     line_number_table = EUCALL_2(Fn_cons, (LispObject)my_yy_val,line_number_table);
  1166.     return(line_number_table);    /* really the line number table and
  1167.                  the S expression */
  1168.   }
  1169. }
  1170.